package com.ecmp.demo.entity;

import com.ecmp.core.entity.*;
import com.ecmp.core.entity.auth.IDataAuthEntity;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by Administrator on 2017/8/11.
 */
    /**
     * Created by Administrator on 2017/8/11.
     */
    @Access(AccessType.FIELD)
    @Entity()
    @Table(name = "Community")
    @DynamicInsert
    @DynamicUpdate

    public class Community extends BaseAuditableEntity implements ITenant, ICodeUnique, IRank, IFrozen, IDataAuthEntity {

        @Column(length = 100, nullable = false)
        private String name;

        @Column(length = 20, nullable = false, unique = true)
        private  String code;

        @Column(name = "tenant_code", length = 10, nullable = false)
        private String tenantCode;

        @Column(name = "rank", nullable = false)
        private Integer rank;

        @Column(name = "frozen", nullable = false)
        private boolean frozen;


        @Override
        public String getName() {
            return name;
        }

        @Override
        public void setName(String name) {
            this.name = name;
        }

        @Override
        public String getCode() {
            return code;
        }

        @Override
        public void setCode(String code) {
            this.code = code;
        }

        @Override
        public String getTenantCode() {
            return tenantCode;
        }

        @Override
        public void setTenantCode(String tenantCode) {
            this.tenantCode = tenantCode;
        }

        @Override
        public Integer getRank() {
            return rank;
        }

        public void setRank(Integer rank) {
            this.rank = rank;
        }

        public Boolean getFrozen() {
            return frozen;
        }

        public void setFrozen(Boolean frozen) {
            this.frozen = frozen;
        }

    }
